<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /* 多维数组的解构 */
        const arr = [1,[2,[3,[4,[5,[6]]]]]]
        /* 我们的目的要获取到这个6 */
        // console.log(arr[1][1][1][1][1][0]);

        //解构赋值来获取这个6
        // const [a,[b,[c,[d,[e,[f]]]]]] = arr;
        // console.log(a,b,c,d,e,f);

        /* 多维对象的解构 */
        const obj = {
            name1:"张三",
            age:18,
            address:{
                info1:"深圳",
                info2:"长沙"
            }
        }
        // console.log(obj);
        /* const {name,age,address:{info1,info2}} = obj;
        console.log(name,age,info1,info2); */
        /* 别名:就是小名 */
        const {name1:username,age,address:{info1,info2}} = obj;
        console.log(name1,username,age,info1,info2);
    </script>
</body>
</html>